package cn.edu.jsu.official.pojo.dto;

import cn.edu.jsu.official.serializer.DateSerializer;
import cn.edu.jsu.official.serializer.DateTimeSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * @author Mo
 * @createTime 2022/3/26 14:17
 * @description
 */
@Data
@Document(collection = "history_process")
public class HistoryProcess {
    @Id
    private String historyProcessId;

    @JSONField(serializeUsing = DateSerializer.class, deserializeUsing = DateSerializer.class)
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date eventDate;

    @ApiModelProperty("事件")
    private String event;

    public HistoryProcess() {
    }

    public HistoryProcess(String historyProcessId, Date eventDate, String event) {
        this.historyProcessId = historyProcessId;
        this.eventDate = eventDate;
        this.event = event;
    }

    public String getHistoryProcessId() {
        return historyProcessId;
    }

    public void setHistoryProcessId(String historyProcessId) {
        this.historyProcessId = historyProcessId;
    }

    public Date getEventDate() {
        return eventDate;
    }

    public void setEventDate(Date eventDate) {
        this.eventDate = eventDate;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    @Override
    public String toString() {
        return "HistoryProcess{" +
                "historyProcessId='" + historyProcessId + '\'' +
                ", eventDate=" + eventDate +
                ", event='" + event + '\'' +
                '}';
    }
}
